package flex.persistence {
	public class FlushModeType extends AbstractType {
		protected static var localInstantiation:Boolean = false;

		private static var _AUTO:FlushModeType; 
		public static function get AUTO():FlushModeType {
			if(!_AUTO) {
				localInstantiation = true;
				_AUTO = new FlushModeType("AUTO");	
				localInstantiation = false;
			}
			return _AUTO;
		} 
		private static var _COMMIT:FlushModeType; 
		public static function get COMMIT():FlushModeType {
			if(!_COMMIT) {
				localInstantiation = true;
				_COMMIT = new FlushModeType("COMMIT");	
				localInstantiation = false;
			}
			return _COMMIT;
		} 

		public static function valueOf(name:String):FlushModeType {
			for each(var val:FlushModeType in values()) {
				if(val.name.toUpperCase() == name.toUpperCase()) return val;
			}
			return null;
		}
		
		public static function values():Array {
			return [AUTO, COMMIT];
		}
		
		public function FlushModeType(name:String) {
			if(!localInstantiation) throw Error("Private constructor");
			this.name = name;
		}
		
	}
}